home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / Processes.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  5.2 KB  |  205 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Processes.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Processes;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __PROCESSES__}
  27. {$SETC __PROCESSES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ProcessesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __EVENTS__}
  40. {$I Events.p}
  41. {$ENDC}
  42. {    Quickdraw.p                                                    }
  43. {        MixedMode.p                                                }
  44. {        QuickdrawText.p                                            }
  45. {    OSUtils.p                                                    }
  46. {        Memory.p                                                }
  47.  
  48. {$IFC UNDEFINED __FILES__}
  49. {$I Files.p}
  50. {$ENDC}
  51.  
  52. {$PUSH}
  53. {$ALIGN MAC68K}
  54. {$LibExport+}
  55.  
  56. TYPE
  57.     ProcessSerialNumber = RECORD
  58.         highLongOfPSN:            LONGINT;
  59.         lowLongOfPSN:            LONGINT;
  60.     END;
  61.     ProcessSerialNumberPtr = ^ProcessSerialNumber;
  62.  
  63.  
  64. CONST
  65. { Process identifier - Various reserved process serial numbers }
  66.     kNoProcess                    = 0;
  67.     kSystemProcess                = 1;
  68.     kCurrentProcess                = 2;
  69.  
  70. { Definition of the parameter block passed to _Launch
  71.     Typedef and flags for launchControlFlags field }
  72.     
  73. TYPE
  74.     LaunchFlags = INTEGER;
  75.  
  76.  
  77. CONST
  78. { Definition of the parameter block passed to _Launch }
  79.     launchContinue                = $4000;
  80.     launchNoFileFlags            = $0800;
  81.     launchUseMinimum            = $0400;
  82.     launchDontSwitch            = $0200;
  83.     launchAllow24Bit            = $0100;
  84.     launchInhibitDaemon            = $0080;
  85.  
  86. { Format for first AppleEvent to pass to new process.  The size of the overall
  87.   buffer variable: the message body immediately follows the messageLength }
  88.  
  89. TYPE
  90.     AppParameters = RECORD
  91.         theMsgEvent:            EventRecord;
  92.         eventRefCon:            LONGINT;
  93.         messageLength:            LONGINT;
  94.     END;
  95.     AppParametersPtr = ^AppParameters;
  96.  
  97. { Parameter block to _Launch }
  98.     LaunchParamBlockRec = RECORD
  99.         reserved1:                LONGINT;
  100.         reserved2:                INTEGER;
  101.         launchBlockID:            INTEGER;
  102.         launchEPBLength:        LONGINT;
  103.         launchFileFlags:        INTEGER;
  104.         launchControlFlags:        LaunchFlags;
  105.         launchAppSpec:            FSSpecPtr;
  106.         launchProcessSN:        ProcessSerialNumber;
  107.         launchPreferredSize:    LONGINT;
  108.         launchMinimumSize:        LONGINT;
  109.         launchAvailableSize:    LONGINT;
  110.         launchAppParameters:    AppParametersPtr;
  111.     END;
  112.     LaunchPBPtr = ^LaunchParamBlockRec;
  113.  
  114. { Set launchBlockID to extendedBlock to specify that extensions exist.
  115.  Set launchEPBLength to extendedBlockLen for compatibility.}
  116.  
  117. CONST
  118.     extendedBlock                = $4C43;                        { 'LC' }
  119.     extendedBlockLen            = 32;                            { sizeof(LaunchParamBlockRec) - 12 }
  120.  
  121. { Definition of the information block returned by GetProcessInformation }
  122.     modeDeskAccessory            = $00020000;
  123.     modeMultiLaunch                = $00010000;
  124.     modeNeedSuspendResume        = $00004000;
  125.     modeCanBackground            = $00001000;
  126.     modeDoesActivateOnFGSwitch    = $00000800;
  127.     modeOnlyBackground            = $00000400;
  128.     modeGetFrontClicks            = $00000200;
  129.     modeGetAppDiedMsg            = $00000100;
  130.     mode32BitCompatible            = $00000080;
  131.     modeHighLevelEventAware        = $00000040;
  132.     modeLocalAndRemoteHLEvents    = $00000020;
  133.     modeStationeryAware            = $00000010;
  134.     modeUseTextEditServices        = $00000008;
  135.     modeDisplayManagerAware        = $00000004;
  136.  
  137. { Record returned by GetProcessInformation }
  138.  
  139. TYPE
  140.     ProcessInfoRec = RECORD
  141.         processInfoLength:        LONGINT;
  142.         processName:            StringPtr;
  143.         processNumber:            ProcessSerialNumber;
  144.         processType:            LONGINT;
  145.         processSignature:        OSType;
  146.         processMode:            LONGINT;
  147.         processLocation:        Ptr;
  148.         processSize:            LONGINT;
  149.         processFreeMem:            LONGINT;
  150.         processLauncher:        ProcessSerialNumber;
  151.         processLaunchDate:        LONGINT;
  152.         processActiveTime:        LONGINT;
  153.         processAppSpec:            FSSpecPtr;
  154.     END;
  155.     ProcessInfoRecPtr = ^ProcessInfoRec;
  156.  
  157.  
  158. FUNCTION LaunchApplication(LaunchParams: LaunchPBPtr): OSErr;
  159.     {$IFC NOT GENERATINGCFM}
  160.     INLINE $205F, $A9F2, $3E80;
  161.     {$ENDC}
  162. FUNCTION LaunchDeskAccessory({CONST}VAR pFileSpec: FSSpec; pDAName: ConstStr255Param): OSErr;
  163.     {$IFC NOT GENERATINGCFM}
  164.     INLINE $3F3C, $0036, $A88F;
  165.     {$ENDC}
  166. FUNCTION GetCurrentProcess(VAR PSN: ProcessSerialNumber): OSErr;
  167.     {$IFC NOT GENERATINGCFM}
  168.     INLINE $3F3C, $0037, $A88F;
  169.     {$ENDC}
  170. FUNCTION GetFrontProcess(VAR PSN: ProcessSerialNumber): OSErr;
  171.     {$IFC NOT GENERATINGCFM}
  172.     INLINE $70FF, $2F00, $3F3C, $0039, $A88F;
  173.     {$ENDC}
  174. FUNCTION GetNextProcess(VAR PSN: ProcessSerialNumber): OSErr;
  175.     {$IFC NOT GENERATINGCFM}
  176.     INLINE $3F3C, $0038, $A88F;
  177.     {$ENDC}
  178. FUNCTION GetProcessInformation({CONST}VAR PSN: ProcessSerialNumber; VAR info: ProcessInfoRec): OSErr;
  179.     {$IFC NOT GENERATINGCFM}
  180.     INLINE $3F3C, $003A, $A88F;
  181.     {$ENDC}
  182. FUNCTION SetFrontProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  183.     {$IFC NOT GENERATINGCFM}
  184.     INLINE $3F3C, $003B, $A88F;
  185.     {$ENDC}
  186. FUNCTION WakeUpProcess({CONST}VAR PSN: ProcessSerialNumber): OSErr;
  187.     {$IFC NOT GENERATINGCFM}
  188.     INLINE $3F3C, $003C, $A88F;
  189.     {$ENDC}
  190. FUNCTION SameProcess({CONST}VAR PSN1: ProcessSerialNumber; {CONST}VAR PSN2: ProcessSerialNumber; VAR result: BOOLEAN): OSErr;
  191.     {$IFC NOT GENERATINGCFM}
  192.     INLINE $3F3C, $003D, $A88F;
  193.     {$ENDC}
  194.  
  195. {$ALIGN RESET}
  196. {$POP}
  197.  
  198. {$SETC UsingIncludes := ProcessesIncludes}
  199.  
  200. {$ENDC} {__PROCESSES__}
  201.  
  202. {$IFC NOT UsingIncludes}
  203.  END.
  204. {$ENDC}
  205.